package com.yifeng.repo.micro.service.server.msg;

import com.yifeng.repo.micro.service.server.msg.service.MsgServices;
import feign.Param;
import feign.RequestLine;
import next.fire.msg.center.api.exception.MsgCenterException;
import next.fire.msg.center.api.model.*;
import next.fire.msg.center.api.model.enums.TemplateTypeEnum;
import next.fire.msg.center.publics.page.PageResult;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;

@FeignClient(name = "msg", url = "${yfcloud.micro.service.msg.url}", path = "/msg-center-rest-web/openx/msg/")
public interface MsgClient extends MsgServices {

    @Override
    @RequestLine("POST /messageService/batchSend")
    void batchSend(@Param("batchCode") String batchCode, @Param("tplGroupId") String tplGroupId, @Param("groups") List<TplGroupMessageBody> groups);

    @Override
    @RequestLine("POST /msgCenterService/sendCode")
    String sendCode(@Param("tplGroupId") String tplGroupId, @Param("phone") String phone);

    @Override
    @RequestLine("POST /msgCenterService/checkCode")
    boolean checkCode(@Param("tplGroupId") String tplGroupId, @Param("phone") String phone, @Param("code") String code);

    @Override
    @RequestLine("POST /msgCenterService/getVerifiyCode")
    String getVerifiyCode(@Param("appId") String appId, @Param("customerCode") String customerCode) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/batchSendMsg")
    void batchSendMsg(@Param("tplGroupId") String tplGroupId, @Param("groups") List<TplGroupBody> groups) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/batchSendNonMemberMpMsg")
    void batchSendNonMemberMpMsg(@Param("tplGroupId") String tplGroupId, @Param("groups") List<MpTplGroupBody> groups) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/sendAllClassMsg")
    Boolean sendAllClassMsg(@Param("appId") String tplGroupId, @Param("tplGroupBody") TplGroupBody tplGroupBody);

    @Override
    @RequestLine("POST /msgCenterService/batchSendAllClassMsg")
    void batchSendAllClassMsg(@Param("tplGroupId") String tplGroupId, @Param("groups") List<TplGroupBody> groups) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/batchSendAllClassMsg")
    void batchSendAllClassMsg(@Param("batchCode") String batchCode, @Param("tplGroupId") String tplGroupId,  @Param("groups") List<TplGroupBody> groups) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/listAppTemplateGroup")
    List<TemplateGroup> listAppTemplateGroup(@Param("appId") String appId, @Param("templateGroupName") String templateGroupName);

    @Override
    @RequestLine("POST /msg/msgCenterService/selectWxTplMsg")
    PageResult<WxTpl> selectWxTplMsg(@Param("wxTpl") WxTpl wxTpl, @Param("page") int page, @Param("limit") int limit) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/listTemplate")
    List<TemplateInfo> listTemplate(@Param("appId") String appId, @Param("templateTypeEnum") TemplateTypeEnum templateTypeEnum);

    @Override
    @RequestLine("POST /msgCenterService/sendGroupMsg")
    String sendGroupMsg(@Param("groupMsgBody") GroupMsgBody groupMsgBody) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/sendCustomerServiceMsg")
    String sendCustomerServiceMsg(@Param("param") CustomerServiceParam param) throws MsgCenterException;

    @Override
    @RequestLine("POST /msgCenterService/sendWxPreview")
    Boolean sendWxPreview(@Param("wxTplId") String wxTplId, @Param("tplGroupBody") TplGroupBody tplGroupBody);

    @Override
    @RequestLine("POST /msgCenterService/sendWxWorkTplMsg")
    String sendWxWorkTplMsg(@Param("wxWorkBody") WxWorkBody wxWorkBody);

    @Override
    @RequestLine("POST /msgCenterService/getWeChatMomentResult")
    void getWeChatMomentResult();

    @Override
    @RequestLine("POST /msgCenterService/getWxWorkMsgResult")
    void getWxWorkMsgResult();

    @Override
    @RequestLine("POST /msgCenterService/pushPendingMsgToMq")
    void pushPendingMsgToMq();

    @Override
    @RequestLine("POST /msgCenterService/pushPendingMsgToMqByHour")
    void pushPendingMsgToMqByHour(String currentHour);
}
